﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Reports.SalesBook
{
    public partial class InputParamForm : Form,IntegrationInterface.IDIProjectForm
    {
        public InputParamForm()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Reports.SalesBook.DataSet data = new Reports.SalesBook.DataSet();
            Reports.SalesBook.DataLoader.GetData(data.Data, this.ConnectionString, Util.Common.DeptName, dtpDateF.Value.Date, dtpDateT.Value.Date.AddDays(1));
            Reports.SalesBook.DataLoader.GetInfo(data.Info, this.ConnectionString, dtpDateF.Value.Date, dtpDateT.Value.Date.AddDays(1));
            Reports.SalesBook.PrintForm pf = new Reports.SalesBook.PrintForm(data);
            string repPath = (string)this.CommonProperty;
            pf.InitReport(repPath);
            pf.MdiParent = this.MdiParent;
            pf.Show();
        }

        #region IDIProjectForm Members
        string _connString;
        public string ConnectionString
        {
            get
            {
                return _connString;
            }
            set
            {
                _connString = value;
            }
        }
        string _login;
        public string Login
        {
            get
            {
                return _login;
            }
            set
            {
                _login = value;
            }
        }

        public Form MailForm
        {
            get 
            {
                return this;
            }
        }
        object _obj;
        public object CommonProperty
        {
            get
            {
                return _obj;
            }
            set
            {
                _obj = value;
            }
        }

        #endregion
    }
}